/**
 * 与search相关的API接口定义
 */
import axios from './config'
import { AxiosPromise } from 'axios'
import {IPlace} from "@/api/config/responseType";


/**
 * 根据输入内容查找对应具体的地址
 */
// 参数接口
export interface reqSearchPlaceArgInterface {
    city_id:number,
    keyword:string,
}
export const reqSearchPlace = (params:reqSearchPlaceArgInterface):AxiosPromise<IPlace[]> =>{
    return axios.request({
        url:'/v1/pois',
        params:params,
        method:'GET',
    })
}

/**
 * 根据搜索显示商铺列表
 */
// 参数接口
export interface reqSearchShopListArgInterface {
    geohash:string |(string | null)[],
    keyword:string,
}
export const reqSearchShopList = (params:reqSearchShopListArgInterface):AxiosPromise<IPlace[]> =>{
    return axios.request({
        url:'/v4/restaurants',
        params:params,
        method:'GET',
    })
}
